package com.gujiangbo.magic;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
 * @Author: gujiangbo.co
 * @Contact: 646832012@qq.com
 * @Date: 2021/12/7 16:30
 * @Version: 1.0
 * @Description:
 */
@SpringBootApplication
//@EnableAutoConfiguration(exclude = {MagicAPIAutoConfiguration.class})
public class MagApplication extends SpringBootServletInitializer implements CommandLineRunner {
    private static final Log debugLog = LogFactory.getLog(MagApplication.class);

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(MagApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(MagApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        debugLog.info("========== magic Application started info  ! ===============");
        debugLog.debug("========= magic Application started debug ! ===============");
        debugLog.error("========= magic Application started error ! ===============");
    }
}
